package com.some;

import java.util.Scanner;

public class AliLi2 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String hexStrTmp = sc.next();
        String hexStr = hexStrTmp.substring(2);
        int sum = 0;
        Integer num = Integer.parseInt(hexStr, 16);
        for (char c : Integer.toBinaryString(num).toCharArray()) {
            if (c == '1') {
                sum++;
            }
        }
        System.out.println(sum);
    }
}
